<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/includes/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="metadata">
       <f:metadata>
           <f:event type="preRenderView" listener="#{locationAdminBacking.init()}"/>
	</f:metadata>
    </ui:define>

    <ui:define name="title">
        场地管理--OfficeBoost System
    </ui:define>

    <ui:define name="content">
        <h:form>
            <font color="blue">
            <h:outputText value="添加场地"/> 
            </font>
            <hr color="#2EA6D7" width="15%" size="2" align="left"/>
            <h:panelGrid columns="4">                              
                <h:outputText value="场地名称"/>
                <h:outputText value="场地用途"/>
                <h:outputText value="场地容量"/>
                <h:outputText value=""/>
                <h:inputText value="#{locationAdminBacking.name}"/>
                <h:inputText value="#{locationAdminBacking.usage}"/>
                <h:inputText value="#{locationAdminBacking.capacity}"/>
                <h:commandButton action="#{locationAdminBacking.addLocation()}" value="添加"/>
            </h:panelGrid>
           
             <font color="blue">
                <h:outputText value="删除场地"/> 
            </font>
            <hr color="#2EA6D7" width="15%" size="2" align="left"/>
            <h:panelGrid columns="3">                              
                <h:outputText value="场地名称"/>                               
                <h:inputText value="#{locationAdminBacking.nametodelete}"/>
                <h:commandButton action="#{locationAdminBacking.deleteLocation()}" value="删除"/>
            </h:panelGrid>
            
            <font color="blue" size="2">
                <h:outputText value="查看场地状态"/> 
            </font>
            <hr color="#2EA6D7" width="15%" size="2" align="left"/>
            <h:panelGrid columns="3">                              
                <h:outputText value="场地名称"/>   
                
                <h:inputText value="#{locationAdminBacking.nametoview}"/>
                <h:commandButton action="#{locationAdminBacking.viewLocation()}" value="查看"/>
            </h:panelGrid>
            <br/>
            <h:outputText value="#{locationAdminBacking.message}"/>
            
            <hr color="#2EA6D7" width="100%" size="3" />
            <h:dataTable border="2" value="#{locationAdminBacking.venueList}" var="loc">
                 <h:column >
                    <f:facet name="header">
                        <h:outputText value="场地名称"/>
                    </f:facet>
                     <h:outputText value="#{loc.id}"/>
                </h:column>
                 <h:column >
                    <f:facet name="header">
                        <h:outputText value="场地用途"/>
                    </f:facet>
                     <h:outputText value="#{loc.theUsage}"/>
                </h:column>
                 <h:column >
                    <f:facet name="header">
                        <h:outputText value="场地容量"/>
                    </f:facet>
                     <h:outputText value="#{loc.tankage}"/>
                </h:column>
            </h:dataTable>
        </h:form>
    </ui:define>

</ui:composition>
